	var proInfo = $.session.get('proInfo');
	var arry = [];
	arry = proInfo.split('-');
	console.log(arry);
	var objarry = [];
	for(index in arry){
		objarry[index] = JSON.parse(arry[index]);
	}
	var newjsoninfo = {"proInfo":objarry};
	for(index in newjsoninfo.proInfo){
		$('#product-box').prepend('<div class="list clearfix transition">'+
				'<div class="tu clearfix">'+
				'<img src="upload/product_img/'+newjsoninfo.proInfo[index].imgname+'"/>'+
				'<span></span>'+
				'<div class="ycang clearfix">'+
					'<samp class="opa8"></samp>'+
					'<div class="nr clearfix">'+
						'<ul>'+
							'<li class="box-s transition">收藏</li>'+
							'<li class="box-s transition" onclick="addShoppingCar('+index+')">购物车</li>'+
						'</ul>'+
					'</div>	'+							
				'</div>'+
			'</div>'+
			'<div class="xia clearfix box-s">'+
				'<p class="bt over">'+
					''+newjsoninfo.proInfo[index].name+''+
				'</p>'+
				'<div class="price clearfix">'+
					'<span class="fl">￥'+newjsoninfo.proInfo[index].price+'<samp>原价￥'+newjsoninfo.proInfo[index].originalprice+'</samp></span>'+
					'<a href="javascript:;" class="goumai fr ra3 transition" onclick="shopping('+index+')">立即购买</a>'+
				'</div>'+
			'</div>'+
		'</div>');
	}
	//获取用户编号
	var usesrcode = $('#usercode').html();
	//接受要加入购物车的商品的信息
	function addShoppingCar(index){
	var product =  
		{  
		    'id':newjsoninfo.proInfo[index].productnumber,        //属性名用引号括起来，属性间由逗号隔开  
		    'name': newjsoninfo.proInfo[index].proname,  
		    'num':1,  
		    'price':newjsoninfo.proInfo[index].price,
		    'imgname':newjsoninfo.proInfo[index].imgname
		}; 
	
	if($.trim(usesrcode) != ''){
		//商品加入到购物车  
		cart.addproduct(product); 
		var productlist=cart.getproductlist();//取出购物车商品  
		$('#carnum').html(productlist.length);
	}else{
		alert("请先登陆");
	} 
	}
	//立即购买 将信息保存到cookie里
	function shopping(g){
		if($.trim(usesrcode) != ''){
			var obj = newjsoninfo.proInfo[g];
			var newstrInfo = JSON.stringify(obj);
			$.cookie('newstrInfo',newstrInfo);
			location.href= 'pro_detail.jsp';
		}else{
			alert("请先登陆");
		}
		
	}
	